//go:build wireinject

package main

import (
	"github.com/google/wire"
	grpc2 "webook/follow/grpc"
	"webook/follow/ioc"
	"webook/follow/repository"
	"webook/follow/repository/cache"
	"webook/follow/repository/dao"
	"webook/follow/service"
)

func Init() *App {
	wire.Build(
		ioc.InitDB,
		ioc.InitLogger,
		ioc.InitRedis,
		dao.NewGORMFollowRelationDAO,
		cache.NewRedisFollowCache,
		repository.NewFollowRelationRepository,
		service.NewFollowRelationService,
		grpc2.NewFollowRelationServiceServer,
		ioc.InitGRPCxServer,
		wire.Struct(new(App), "*"),
	)
	return new(App)
}
